<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<script src="/jquery/jquery-3.5.1.js"></script>
	</head>
	<body>
		<div class="bg1"></div>
		<div class="gyl">
		        用户信息管理系统
		        
		    <div class="gy2" >打造国内最具规模的、最专业的用户信息管理平台 </div>
		</div>
		<div class="bg">
			<div class="wel">用户登录</div>			
	        <div class="user">
	       	    <div style="">用户名</div>
	       	    <input  type="text" name="username" id="username" placeholder="admin" />
	        </div>
	        <div class="password" >
	        	<div>密&nbsp;&nbsp;&nbsp;码</div>
	       	    <input class="" type="password" id="password" name="password" placeholder="......" />
	        </div>
	        <div class="rem" >
	       	  <input type="checkbox" name="" id="" value="" />
	        	 <div id="reb">
	        	 	记住密码
	        	 </div>
	        </div>
	        <div class="fg" >
	       	    <div style="font-size: 11px;margin-top: 11px;">
	       	    	<a style="font-size: 11px;" href="phoneLogin.html">忘记密码？</a>
	       	    </div>
	        </div>
	        <input class="btn" type="button" id="loginButton" name="登录" value="登录" />
		</div>
	<script>
		$("#loginButton").click(function(){
			$.ajax({
				url:"/Login",
				type:"post",
				contentType:"application/json;charset=utf-8",
				data:JSON.stringify({
					username:$("#username").val(),
					password:$("#password").val()
				}),
				success: function (response) {
					alert(response.msg);
					if (response.code == 200) {
						localStorage.setItem("user", JSON.stringify(response.data));
						window.location.href = "index.html";
					}
					// console.log("数据: " + response);
				},
				error:function (response){
					alert("服务器异常，请稍后重试！" + response);
				}
			});
		});

	</script>
	</body>
</html>
